<template>
  <div class="school">
    <h2>学校名称：{{ name }}</h2>
    <h2>学生地址：{{ address }}</h2>
    <button @click="SendSchoolName">把学校名给App</button>
  </div>
</template>

<script>
export default {
  name: "School",
  props:['getSchoolName'],
  data() {
    return {
      name: "尚硅谷atsgg",
      address: "北京",
    };
  },
  methods: {
    SendSchoolName() {
      this.getSchoolName(this.name)
    },
  },
};
</script>

<style lang="less" scoped>
.school {
  background-color: orange;
  .pOne {
    font-size: 50px;
    color: red;
  }
}
</style>
